package cn.tedu._04weibo.base.expection;

import cn.tedu._04weibo.base.response.jsonresulte;
import cn.tedu._04weibo.base.response.statuscode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class expection
{
    @ExceptionHandler(RuntimeException.class)
    public jsonresulte handleRuntimeException(RuntimeException e)
    {
        log.error("运行时异常:{}",e.getMessage());
        return new jsonresulte(statuscode.FAIL);
    }
}
